--#include "CrossUnionWar.lua" once
--#include "CrossLeagueMatches.lua" once
--#include "CrossGatherCrystal.lua" once
--#include "CrossEatChicken.lua" once


--[[
function InitCrossUnionWar()
	SceneReliveDispatcher.register(CrossUnionWarCfg.unionTeams[1].EnterPos[1], CrossUnionWarRelive)

	SceneLogoutDispatcher.register(CrossUnionWarCfg.unionTeams[1].EnterPos[1], CrossUnionWarLeaveActivity)

	SceneDieDispatcher.register(CrossUnionWarCfg.unionTeams[1].EnterPos[1], CrossUnionWarActorDeath)

    SceneExitDispatcher.register(CrossUnionWarCfg.unionTeams[1].EnterPos[1], CrossUnionWarLeaveActivityHandler)

    for idx = 1, #CrossUnionWarCfg.ExchangeItems do
	    ItemAddDispatcher.register( CrossUnionWarCfg.ExchangeItems[idx].id, CrossUnionWarPickItem )             --注册获得某个道具触发的事件
    	ItemRemoveDispatcher.register( CrossUnionWarCfg.ExchangeItems[idx].id, CrossUnionWarDropItem )
	end
end


table.insert(InitFnTable, InitCrossUnionWar)
]]

--跨服联赛
function InitCrossLeagueMatches()
    SceneReliveDispatcher.register(CrossLeagueMatchesCfg.sceneId, CrossLeagueMatchesRelive)

    SceneLogoutDispatcher.register(CrossLeagueMatchesCfg.sceneId, CrossLeagueMatchesLeaveActivity)

    SceneHandExitDispatcher.register( CrossLeagueMatchesCfg.sceneId,  CrossLeagueMatchesLeaveActivity )

    SceneDieDispatcher.register(CrossLeagueMatchesCfg.sceneId, CrossLeagueMatchesActorDeath)

    SceneExitDispatcher.register(CrossLeagueMatchesCfg.sceneId, CrossLeagueMatchesLeaveActivityHandler)

    FubenTimeoutDispatcher.register( CrossLeagueMatchesCfg.fubenId, CrossLeagueMatchesTimeout ) 

    for idx = 1, #CrossLeagueMatchesCfg.SignFailWhenEnterScenes do
        SceneEnterDispatcher.register(CrossLeagueMatchesCfg.SignFailWhenEnterScenes[idx], CrossLeagueMatchesEnterSceneHandler)
    end    
end

table.insert(InitFnTable, InitCrossLeagueMatches)

--跨服采集水晶
function InitCrossGatherCrystal()
    SceneEnterDispatcher.register(CrossGatherCrystalCfg.sceneId, CrossGatherCrystalEnterActivityHandler)
    SceneExitDispatcher.register(CrossGatherCrystalCfg.sceneId, CrossGatherCrystalLeaveActivityHandler)
    for idx = 1, #CrossGatherCrystalCfg.ExchangeItems do
        ItemAddDispatcher.register( CrossGatherCrystalCfg.ExchangeItems[idx].id, CrossGatherCrystalPickItem )             --注册获得某个道具触发的事件
        ItemRemoveDispatcher.register( CrossGatherCrystalCfg.ExchangeItems[idx].id, CrossGatherCrystalDropItem )
    end
end

table.insert(InitFnTable, InitCrossGatherCrystal)


--跨服吃鸡
function InitCrossEatChicken()
    SceneReliveDispatcher.register(CrossEatChickenCfg.sceneId, CrossEatChickenLeaveActivity)
    
    SceneLogoutDispatcher.register(CrossEatChickenCfg.sceneId, CrossEatChickenLeaveActivity)

    SceneHandExitDispatcher.register( CrossEatChickenCfg.sceneId,  CrossEatChickenLeaveActivity )

    SceneDieDispatcher.register(CrossEatChickenCfg.sceneId, CrossEatChickenActorDeath)

    SceneExitDispatcher.register(CrossEatChickenCfg.sceneId, CrossEatChickenLeaveActivityHandler)

    FubenTimeoutDispatcher.register( CrossEatChickenCfg.fubenId, CrossEatChickenTimeout ) 

    for idx = 1, #CrossEatChickenCfg.SignFailWhenEnterScenes do
        SceneEnterDispatcher.register(CrossEatChickenCfg.SignFailWhenEnterScenes[idx], CrossEatChickenEnterSceneHandler)
    end    

    for idx = 1, #CrossEatChickenCfg.items do
        ItemAddDispatcher.register( CrossEatChickenCfg.items[idx].id, CrossEatChickenPickItem )             --注册获得某个道具触发的事件
        ItemRemoveDispatcher.register( CrossEatChickenCfg.items[idx].id, CrossEatChickenDropItem )
    end
end

table.insert(InitFnTable, InitCrossEatChicken)